package test.net
{
	import flash.display.BitmapData;
	import flash.display.Sprite;
	
	import level4.net.third_party_api.photos_center.RRPhotoCenterStruct;
	import level4.net.third_party_api.uploaders.RRPhotoCenterUploader;

	/**
	 * 图片中心上传用例
	 * */
	public class RRPhotoCenterTest
	{
		public function RRPhotoCenterTest()
		{
			var sprite:Sprite = new Sprite();
				sprite.graphics.beginFill(0xff0000);
				sprite.graphics.drawRect(0,0,100,80);
				sprite.graphics.endFill();
				
			var bmd:BitmapData = new BitmapData(sprite.width,sprite.height);
				bmd.draw(sprite);
			
			var struct:RRPhotoCenterStruct = new RRPhotoCenterStruct();
				struct.appName = "carclub";
				struct.userId = "343891780";
				struct.comment = "nothing";
				struct.sessionKey = "2.93dbd0ccbe8eeb4320f6c0319b91f6d7.3600.1306562400-343891780";
				struct.title = "abc";
				struct.url = "http://10.32.16.19:8087/fileUploadServlet.up";
			
			var uploader:RRPhotoCenterUploader = new RRPhotoCenterUploader();
				uploader.UploadFile(struct,"大图.jpg",bmd,"小图.jpg",bmd);
				uploader.onOk =function(resp:String):void{
					trace(resp);
				};
				
		}
		
	}
}